package com.yu.demo.user.domain.valueobject;

import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
 * 密码哈希值对象
 * 封装密码哈希的业务规则和验证逻辑
 */
@Getter
@EqualsAndHashCode
public class PasswordHash {
    private final String value;

    public PasswordHash(String value) {
        if (value == null || value.trim().isEmpty()) {
            throw new IllegalArgumentException("密码哈希不能为空");
        }
        if (value.length() < 32) {
            throw new IllegalArgumentException("密码哈希长度不能少于32位");
        }
        this.value = value;
    }

    @Override
    public String toString() {
        return value;
    }
}
